package com.mall.untils;

import java.io.FileNotFoundException;
import java.io.InputStream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 *上传文件
 */
public class UploadImgThread implements Runnable{
	Logger logger = LoggerFactory.getLogger(UploadImgThread.class);
	private InputStream in;
	private long fileLength;
	private String fileName;
	private String path;
	@Override
	public void run() {
		try {
			UploadImgOrRecorderUtil.putObject(Constants.BUCKETNAME, this.fileName, this.in, this.fileLength);
			logger.info("线程文件上传成功！======================"+this.path);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			logger.info("线程文件上传失败！");
		}
	}
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public InputStream getIn() {
		return in;
	}
	public void setIn(InputStream in) {
		this.in = in;
	}
	public long getFileLength() {
		return fileLength;
	}
	public void setFileLength(long fileLength) {
		this.fileLength = fileLength;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	
}
